<template>
	<div>
		
		
		<van-nav-bar
		  
		  left-text="返回"
		  right-text="注册"
		  left-arrow
		  @click-left="onClickLeft"
		   @click-right="onClickright"
		/>	
		<h2>用户登录</h2>
		<van-cell-group>
  <van-field
    v-model="username"
   
    clearable
	left-icon='manager'
    label="用户名" 
    placeholder="请输入用户名"
    @click-right-icon="$toast('question')"
  />

  <van-field
    v-model="password"
	left-icon='lock'
    type="password"
    label="密码"
    placeholder="请输入密码"
  />
</van-cell-group>
     <div class="txt">
	<van-checkbox v-model="checked">记住密码</van-checkbox>	
		<div class="van-ellipsis">忘记密码</div>
		</div>
		
		 <div class="btn">
		<van-button plain round size='large' @click='tap()'>登录</van-button>
		</div>
		 <van-divider  class="tos">其他登录方式</van-divider>
		
	</div>
</template>

<script>
	import { Toast } from 'vant';
	export default{
		name:'denglu',
		  data() {
			  
    return {
      checked: true,
	  username:'',
	  password:''
    };
  },
  methods:{
	  onClickLeft(){
		 Toast('返回');
		  	 this.$router.go(-1)
	  },
	  onClickright(){
		 Toast('按钮'); 
	  },
	  tap(){
		  axios({
			  url:'http://w34uc5.natappfree.cc/secondHand/user/userLogin'
		  }).then((data)=>{
			  console.log(data.data)
		  })
	  }
  }
	}
</script>

<style>
	h2{
		text-align: center;
	}
	.txt{
		width:300px;
		height:30px;
		display: flex;
		justify-content:space-between;
		font-size: 14px;
	}
	.btn{
		width:150px;
		height:30px;
		margin-top: 40px;
		margin-left: 30%;
	}
	.tos{
		margin-top: 200px;
	}
</style>
